<?php

namespace YouBaoLian\Application\Request;

use YouBaoLian\Application\Info\CarInfo;
use YouBaoLian\Application\Info\CarTaxInfo;
use YouBaoLian\Application\Info\ChargingPostList;
use YouBaoLian\Application\Info\CoverageList;
use YouBaoLian\Application\Info\ExtInfo;
use YouBaoLian\Application\Info\InsProductPlansList;
use YouBaoLian\Application\Info\ParergonSaleInfo;
use YouBaoLian\Application\Info\PersonInfo;
use YouBaoLian\Application\Info\SaleInfo;
use YouBaoLian\Application\Response\RenewalResponse;
use YouBaoLian\Application\Response\VehicleModelResponse;
use YouBaoLian\Application\Response\VehicleNoCarProductResponse;
use YouBaoLian\Application\Response\VehicleQuoteResponse;

class VehicleQuoteRequest extends Request
{

    /**
     * 保司ID
     * @var int $supplierId
     */
    private $supplierId = 0;

    /**
     * 续保保司Id
     * @var int $renewSupplierId
     */
    private $renewSupplierId = 0;
    /**
     * 报价配置ID
     * @var int $configId
     */
    private $configId = 0;

    /**
     * 城市编码
     * @var string $cityCode
     */
    private $cityCode = '';

    /**
     * 交强险起保日期
     * @var string $ciBeginDate
     */
    private $ciBeginDate;

    /**
     * 商业险起保日期
     * @var string $biBeginDate
     */
    private $biBeginDate;

    /**
     * 交强险是否即时生效
     * @var bool $ciDateAtOnce
     */
    private $ciDateAtOnce = false;

    /**
     * 商业险是否即时生效
     * @var bool $biDateAtOnce
     */
    private $biDateAtOnce = false;


    /**
     * 交强转保码
     * @var string $ciCheckCode
     */
    private $ciCheckCode = '';

    /**
     * 商业转保码
     * @var string $biCheckCode
     */
    private $biCheckCode = '';

    /**
     * 允许自动变更投保日期
     * @var  $allowAutoChangeInsuranceDate
     */
    private $allowAutoChangeInsuranceDate = true;

    /**
     * 投保人信息
     * @var PersonInfo $applicantInfo
     */
    private $applicantInfo;

    /**
     * 被保人对象
     * @var PersonInfo $insuredInfo
     */
    private $insuredInfo;

    /**
     * 车主信息
     * @var PersonInfo $ownerInfo
     */
    private $ownerInfo;

    /**
     * 车辆信息
     * @var CarInfo $carInfo
     */
    private $carInfo;

    /**
     * 车船税信息
     * @var CarTaxInfo $carTaxInfo
     */
    private $carTaxInfo;

    /**
     * 险种列表
     * @var CoverageList $coverageList
     */
    private $coverageList;

    /**
     * 新能源汽车，投保附加自用充电桩
     * @var ChargingPostList $chargingPostList
     */
    private $chargingPostList;

    /**
     * 扩展信息
     * @var ExtInfo $extInfo
     */
    private $extInfo;

    /**
     * 非车险信息
     * @var InsProductPlansList $insProductPlans
     */
    private $insProductPlans;

    /**
     * 北京兼业从业人员
     * @var ParergonSaleInfo $jianYeSalerInfo
     */
    private $jianYeSalerInfo;

    /**
     * 发起该次查验请求终端设备的物理网卡地址 平安必传
     * @var string $macAddress
     */
    private $macAddress = '';

    /**
     * 请求终端设备的ip地址  平安必传
     * @var string $ip
     */
    private $ip = '';

    /**
     * 已提供本地使用证明
     * @var string $isOfferLocalUseProof
     */
    private $isOfferLocalUseProof = '';

    /**
     * 业务等级
     * @var string $businessLevel
     */
    private $businessLevel = '';

    /**
     * 请求终端设备类型 平安必传 1：可移动设备 2：不可移动设备
     * @var string $deviceType
     */
    private $deviceType = '';

    /**
     * 广东，深圳双录销售信息
     * @var SaleInfo $saleInfo
     */
    private $saleInfo;

    /**
     * customerId
     * @var int $customerId
     */
    private $customerId = 0;

    /**
     * @var string $method
     */
    protected $method = 'iebcVehicle.quote';

    /**
     * @var string $response
     */
    protected $response = VehicleQuoteResponse::class;

    /**
     * @return array
     */
    public function getBizContent(): array
    {
        $this->bizContent = [
            'ciBeginDate' => $this->ciBeginDate,
            'biBeginDate' => $this->biBeginDate,
            'ciDateAtOnce' => $this->ciDateAtOnce,
            'biDateAtOnce' => $this->biDateAtOnce,
//            'ciCheckCode' => $this->ciCheckCode,
//            'biCheckCode' => $this->biCheckCode,
            'cityCode' => $this->cityCode,
            'supplierId' => $this->supplierId,
            'configId' => $this->configId,
            //关系人
            'applicantInfo' => $this->applicantInfo->getInfo(),
            'insuredInfo' => $this->insuredInfo->getInfo(),
            'ownerInfo' => $this->ownerInfo->getInfo(),
            //车辆信息
            'carInfo' => $this->carInfo->getInfo(),
            //车船税信息
            'carTaxInfo' => $this->carTaxInfo->getInfo(),
            //险种列表
            'coverageList' => $this->coverageList->getList(),
            //北京兼业从业人员
            'jianYeSalerInfo' => null,

            //允许自动变更投保日期
            'allowAutoChangeInsuranceDate' => $this->allowAutoChangeInsuranceDate,
            //广东，深圳双录销售信息
            'saleInfo' => null,




            //
            'macAddress' => $this->macAddress,
            'ip' => $this->ip,
            'deviceType' => $this->deviceType,
            //已提供本地使用证明
            'isOfferLocalUseProof' => $this->isOfferLocalUseProof,
            //业务等级
            'businessLevel' => $this->businessLevel,
        ];

        //续保id
        if ($this->renewSupplierId) {
            $this->bizContent['renewSupplierId'] = $this->renewSupplierId;
        }
        //新能源汽车 投保附加自用充电桩
        if ($this->chargingPostList) {
            $this->bizContent['chargingPostList'] = $this->chargingPostList->getList();
        }
        //扩展信息
        if ($this->extInfo) {
            $this->bizContent['extInfo'] = $this->extInfo->getInfo();
        }
        //非车险信息
        if ($this->insProductPlans) {
            $this->bizContent['insProductPlans'] = $this->insProductPlans->getList();
        }
        //北京兼业从业人员
        if ($this->jianYeSalerInfo) {
            $this->bizContent['jianYeSalerInfo'] = $this->jianYeSalerInfo->getInfo();
        }
        //广东，深圳双录销售信息
        if ($this->saleInfo) {
            $this->bizContent['saleInfo'] = $this->saleInfo->getInfo();
        }
        //
        if ($this->customerId) {
            $this->bizContent['customerId'] = $this->customerId;
        }

        return $this->bizContent;
    }

    /**
     * @param int $supplierId
     */
    public function setSupplierId(int $supplierId): void
    {
        $this->supplierId = $supplierId;
    }

    /**
     * @param int $renewSupplierId
     */
    public function setRenewSupplierId(int $renewSupplierId): void
    {
        $this->renewSupplierId = $renewSupplierId;
    }

    /**
     * @param int $configId
     */
    public function setConfigId(int $configId): void
    {
        $this->configId = $configId;
    }

    /**
     * @param string $cityCode
     */
    public function setCityCode(string $cityCode): void
    {
        $this->cityCode = $cityCode;
    }

    /**
     * @param string $ciBeginDate
     */
    public function setCiBeginDate(string $ciBeginDate): void
    {
        $this->ciBeginDate = $ciBeginDate;
    }

    /**
     * @param string $biBeginDate
     */
    public function setBiBeginDate(string $biBeginDate): void
    {
        $this->biBeginDate = $biBeginDate;
    }

    /**
     * @param bool $ciDateAtOnce
     */
    public function setCiDateAtOnce(bool $ciDateAtOnce): void
    {
        $this->ciDateAtOnce = $ciDateAtOnce;
    }

    /**
     * @param bool $biDateAtOnce
     */
    public function setBiDateAtOnce(bool $biDateAtOnce): void
    {
        $this->biDateAtOnce = $biDateAtOnce;
    }

    /**
     * @param string $ciCheckCode
     */
    public function setCiCheckCode(string $ciCheckCode): void
    {
        $this->ciCheckCode = $ciCheckCode;
    }

    /**
     * @param string $biCheckCode
     */
    public function setBiCheckCode(string $biCheckCode): void
    {
        $this->biCheckCode = $biCheckCode;
    }

    /**
     * @param PersonInfo $applicantInfo
     */
    public function setApplicantInfo(PersonInfo $applicantInfo): void
    {
        $this->applicantInfo = $applicantInfo;
    }

    /**
     * @param PersonInfo $insuredInfo
     */
    public function setInsuredInfo(PersonInfo $insuredInfo): void
    {
        $this->insuredInfo = $insuredInfo;
    }

    /**
     * @param PersonInfo $ownerInfo
     */
    public function setOwnerInfo(PersonInfo $ownerInfo): void
    {
        $this->ownerInfo = $ownerInfo;
    }

    /**
     * @param CarInfo $carInfo
     */
    public function setCarInfo(CarInfo $carInfo): void
    {
        $this->carInfo = $carInfo;
    }

    /**
     * @param CarTaxInfo $carTaxInfo
     */
    public function setCarTaxInfo(CarTaxInfo $carTaxInfo): void
    {
        $this->carTaxInfo = $carTaxInfo;
    }

    /**
     * @param CoverageList $coverageList
     */
    public function setCoverageList(CoverageList $coverageList): void
    {
        $this->coverageList = $coverageList;
    }

    /**
     * @param ChargingPostList $chargingPostList
     */
    public function setChargingPostList(ChargingPostList $chargingPostList): void
    {
        $this->chargingPostList = $chargingPostList;
    }

    /**
     * @param ExtInfo $extInfo
     */
    public function setExtInfo(ExtInfo $extInfo): void
    {
        $this->extInfo = $extInfo;
    }

    /**
     * @param InsProductPlansList $insProductPlans
     */
    public function setInsProductPlans(InsProductPlansList $insProductPlans): void
    {
        $this->insProductPlans = $insProductPlans;
    }

    /**
     * @param ParergonSaleInfo $jianYeSalerInfo
     */
    public function setJianYeSalerInfo(ParergonSaleInfo $jianYeSalerInfo): void
    {
        $this->jianYeSalerInfo = $jianYeSalerInfo;
    }

    /**
     * @param string $macAddress
     */
    public function setMacAddress(string $macAddress): void
    {
        $this->macAddress = $macAddress;
    }

    /**
     * @param string $ip
     */
    public function setIp(string $ip): void
    {
        $this->ip = $ip;
    }

    /**
     * @param string $deviceType
     */
    public function setDeviceType(string $deviceType): void
    {
        $this->deviceType = $deviceType;
    }

    /**
     * @param SaleInfo $saleInfo
     */
    public function setSaleInfo(SaleInfo $saleInfo): void
    {
        $this->saleInfo = $saleInfo;
    }

    /**
     * @param int $customerId
     */
    public function setCustomerId(int $customerId): void
    {
        $this->customerId = $customerId;
    }

    /**
     * @param string $isOfferLocalUseProof
     */
    public function setIsOfferLocalUseProof(string $isOfferLocalUseProof): void
    {
        $this->isOfferLocalUseProof = $isOfferLocalUseProof;
    }

    /**
     * @param string $businessLevel
     */
    public function setBusinessLevel(string $businessLevel): void
    {
        $this->businessLevel = $businessLevel;
    }

    /**
     * @param mixed $allowAutoChangeInsuranceDate
     */
    public function setAllowAutoChangeInsuranceDate(bool $allowAutoChangeInsuranceDate): void
    {
        $this->allowAutoChangeInsuranceDate = $allowAutoChangeInsuranceDate;
    }



}
